<template>
    <div class="">
        <h1>h5页面支付</h1>
        <h3>注意: 必须在微信以外的浏览器打开</h3>

        <br>
        <br>
        <br>
        <button @click="goPay">支付0.01元</button>
    </div>
</template>

<script>
import axios from 'axios'
// 必须用80端口
const serveHost = "http://www.bufantec.com";
//调用支付的页面host
const localHost = "http://bufantec.natapp1.cc";
var payApi = `${serveHost}/wx/pay/wap2`
export default {
    components: {

    },
    data() {
        return {

        };
    },
    computed: {

    },
    created() {

    },
    mounted() {

    },
    methods: {
        goPay(){
            // h5支付 是无法知道用户的身份的,比如open,支付会跳转到微信客户端执行,但是执行成功得告诉客户端回到哪个页面
            axios.get(payApi)
                .then(res=>{
                    var url = res.data.url;
                    window.location.href = url
                    // 有必要跟后台确认订单 
                })
        }
    },
};
</script>

<style scoped lang="scss">

</style>

